class Solution {
public:
    int sumOddLengthSubarrays(vector<int>& arr) {
int n=0;
        for(int i=0;i<arr.Size();++i){
            int sum=0;
            int L=0;
            for(int j=i;j<arr.Size();++j){
                L++;
                sum=sum+arr[j];
                if(L%2==1) n=n+sum;
            }
        }
        return n;
    }
};